<template>
	<view class="page">
		<nav-bar title="电价详情"></nav-bar>
		<view :style="{'margin-top':navHeight+'px'}">
			<view v-for="(item,index) in billingIntervals" :key="index">
				<carEleCell :data="item"></carEleCell>
			</view>	
		</view>
	</view>
</template>

<script>
	var globalData = getApp({
		allowDefault: true
	}).globalData
	import navBar from '../components/navBar.vue'
	import carEleCell from '../components/carEleCell.vue'
	import * as siteApi from '../../api/site/index.js'
	export default{
		components:{navBar,carEleCell},
		data(){
			return{
				id:'',
				billingIntervals:'',	
				navHeight:0
			}
		},
		onLoad(options) {
			this.id = options.id;
			this.navHeight = globalData.titleHeight;
			this.getCarChargingGroupDetail();
		},
		methods:{
			getCarChargingGroupDetail() {
				siteApi.getCarChargingGroupDetail(this.id).then((res)=>{
					console.log(res.data)
					this.billingIntervals = res.data.billingIntervals
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page{
		background-color:#FFFFFF;
		min-height: 100vh;
	}
</style>
